﻿using System;
using System.Collections.Generic;
//using System.Linq;
using System.Text;
//using System.Threading.Tasks;
using System.Net;
using Urd.Packet;


namespace Urd.Common
{
    /// <summary>
    /// save this managerinfo in sql server
    /// </summary>
    public struct managerinfo
    {
        public string managername;
        public string tablename;
        public string filename;
        public IPAddress address;
        public int port;
        public Opcode able_to_accept;
        public bool Registered;
        public string path;
        public string md5hash;


        /// <summary>
        /// 
        /// </summary>
        /// <param name="opcode">what packet to accept else reject</param>
        /// <param name="Port">port to listen on</param>
        /// <param name="Address">ipaddress</param>
        /// <param name="managerName">name of the manager</param>
        /// <param name="dbfilename">name of sqlite database file. if none managername is used</param>
        /// <param name="dbtablename">tablename in database if none managername is used</param>
        public managerinfo(Opcode opcode,int Port,IPAddress Address,string managerName,string dbfilename="",string dbtablename="")
        {

            able_to_accept = opcode;
            managername = managerName;
            tablename = dbtablename;
            filename = dbfilename;
            address = Address;
            port = Port;
            Registered = false;
            path = "";
            md5hash = "";

        }
    }
}
